import { createSlice } from '@reduxjs/toolkit'

const countSlice = createSlice({
  name: 'count',
  initialState: {
    count: 0
  },
  reducers: {
    changeCountAction(state, { payload }) {
      state.count = state.count + payload
    }
  }
})

export const { changeCountAction } = countSlice.actions
export default countSlice.reducer